from asyncio import Future
from typing import Iterator, Self

from . import eventio
from .device import InputDevice
from .eventio import EvdevError as EvdevError
from .events import InputEvent

class EventIO(eventio.EventIO):
    def async_read_one(self) -> Future[InputEvent | None]: ...
    def async_read(self) -> Future[Iterator[InputEvent]]: ...
    def async_read_loop(self) -> ReadIterator: ...
    def close(self) -> None: ...

class ReadIterator:
    def __init__(self, device: InputDevice) -> None: ...
    def __iter__(self) -> Self: ...
    def __next__(self) -> InputEvent: ...
    def __aiter__(self) -> Self: ...
    def __anext__(self) -> Future[InputEvent]: ...
